package com.ruoyi.activity.service.impl;

import com.ruoyi.activity.domain.WorksDetail;
import com.ruoyi.activity.mapper.WorksDetailMapper;
import com.ruoyi.activity.service.AWorksDetailService;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;

import javax.annotation.Resource;

/**
 * 作品详情表(WorksDetail)表服务实现类
 *
 * @author makejava
 * @since 2024-05-31 17:28:33
 */
@Service("aWorksDetailService")
public class AWorksDetailServiceImpl implements AWorksDetailService {
    @Resource
    private WorksDetailMapper worksDetailMapper;


    /**
     * 新增数据
     *
     * @param worksDetail 实例对象
     * @return 实例对象
     */
    @Override
    public WorksDetail insert(WorksDetail worksDetail) {
        this.worksDetailMapper.insert(worksDetail);
        return worksDetail;
    }



    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.worksDetailMapper.deleteByPrimaryKey(id) > 0;
    }
}
